home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 847 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.8 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: dcc@hpax.cup.hp.com (Don Cameron)
  3. Newsgroups: comp.std.c++
  4. Subject: Can a type be defined in a catch argument?
  5. Date: 25 Mar 1996 09:59:27 PST
  6. Organization: Hewlett Packard, Cupertino
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4ivs16$5j0@hpax.cup.hp.com>
  9. NNTP-Posting-Host: isolde.mti.sgi.com
  10. X-Original-Date: 23 Mar 1996 03:43:34 GMT
  11. X-Newsreader: TIN [version 1.2 PL2]
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBVAwUBMVbfYEy4NqrwXLNJAQEd3QH/TfDWwGZYQkuYYHCEl07YHXkbHzq4bGpq
  14.     EgKNtHNMZUKPHQyVuPb1FsclecmRTSZ/qr/vC9GSqeJZtujvEK2Udg==
  15.     =Jaxw
  16. Originator: austern@isolde.mti.sgi.com
  17.  
  18. Is the following legal?
  19.  
  20.    try {
  21.     // ...
  22.    }
  23.    catch ( class X { // ... } y )
  24.    {
  25.     // ...
  26.    }
  27.  
  28. This would seem to be nonsensical (how can a thrown object's type
  29. match X according to the throw/catch matching rules?), but I can't find
  30. where it's disallowed by the Jan. 96 WP, either in the grammar or in
  31. Section 15.
  32.  
  33. 15.4.6 on exception specifications states
  34.  
  35.    Types shall not be defined in exception-specifications.
  36.  
  37. Isn't a similar restriction needed for exception-declarations (i.e.,
  38. catch arguments)?
  39.  
  40. -----------------------------------------------------------------------------
  41. Don Cameron            dcc@cup.hp.com | you are in a maze of twisty little
  42. HP Calif. Language Lab Cupertino, CA  | assembly instructions, all alike
  43. -----------------------------------------------------------------------------
  44. ---
  45. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  46.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  47.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  48.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  49.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  50. ]
  51.